window.onload = function() {
	var boxHeight = document.documentElement.clientHeight || document.body.clientHeight,
		key = true,
		change = true,
		indiH = parseInt($(".indi-center-con-r").height() + 100);
		

		$(".indi-center-bg").height(boxHeight);
		$(window).resize(function() {
			var boxHeight = document.documentElement.clientHeight || document.body.clientHeight;
			$(".indi-center-bg").height(boxHeight);
		});

		$(".chooseAll").click(function() {
		if(key) {
			$(".indi-center-collect label").css({
				"background" : "url(/themes/mmj/assets/images/" + "indi_icon.png)"
			});
			$(".indi-center-collect input").prop("checked",true);
			key = false;
		} else {
			$(".indi-center-collect label").css({
				"background" : "url(/themes/mmj/assets/images/" + "indi_icon_off.png)"
			});
			$(".indi-center-collect input").prop("checked",false);
			key = true;
		}
	});
		console.log(indiH);
		if(indiH > 795) {
			$(".indi-center-bg").height(indiH);
		} else {
			$(".indi-center-bg").height(boxHeight);
			$(window).resize(function() {
				var boxHeight = document.documentElement.clientHeight || document.body.clientHeight;
				$(".indi-center-bg").height(boxHeight);
			});
			$(".bussniess-hover li").click(function() {
				$(this).siblings().removeAttr("id");
				$(this).attr("id", "bussniess-active");
			});
			
		}


		// 我的收藏页面选中框

		$(".indi-center-choose .indi-center-ch").click(function() {
			var index = $(this).index();
			if(change) {
				$(this).children("label").css({
					"background" : "url(../images/" + "indi_icon.png)"
				});
				$(".indi-center-ch input").eq(index).attr("checked", "true");
				change = false;
				
			} else {
				$(this).children("label").css({
					"background" : "url(../images/" + "indi_icon_off.png)"
				});
				$(".indi-center-ch input").eq(index).removeAttr("checked");
				change = true;
			}
		});

		// control tit
		$(".indi-center-nav div ul li").each(function() {
			$this = $(this);
			if($this[0].href == String(window.location)) {
				$(this).siblings().removeAttr("id");
				$(this).attr("id", "indi-center-nav-common");
				
			}
		})
}